package { 
	import mx.controls.Label; 
	import mx.controls.DataGrid; 
	import mx.controls.dataGridClasses.*; 
	import flash.display.Graphics; 
	
	public class CustomBackgroundTime extends Label { 
		
		override protected function updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):void 
		{ 
			super.updateDisplayList(unscaledWidth, unscaledHeight); 
			var g:Graphics = graphics; 
			g.clear(); 
			var grid1:DataGrid = DataGrid(DataGridListData(listData).owner); 
			/*	if (grid1.isItemSelected(data) || grid1.isItemHighlighted(data)) 
			return;  */
			if (data[DataGridListData(listData).dataField] == 0){ 
				g.beginFill(0x050505); 
			} 
			else if (data[DataGridListData(listData).dataField] == 1){ 
				g.beginFill(0x878787); 
			} 
			else if (data[DataGridListData(listData).dataField] == 2){ 
				g.beginFill(0xCCCCCC); 
			} 
			else if (data[DataGridListData(listData).dataField] == 3){ 
				g.beginFill(0xFFC469); 
			} 
			else if (data[DataGridListData(listData).dataField] == 4) { 
				g.beginFill(0xFFA824); 
			} 
			else if (data[DataGridListData(listData).dataField] == 5) { 
				g.beginFill(0xFF3333); 
			} 
			else if (data[DataGridListData(listData).dataField] == 6) { 
				g.beginFill(0xFF0000); 
			} 
			else if (data[DataGridListData(listData).dataField] == 7){ 
				g.beginFill(0xEE0000); 
			} 
			else if (data[DataGridListData(listData).dataField] == 8){ 
				g.beginFill(0xCD0000); 
			} 
			else if (data[DataGridListData(listData).dataField] == 9){ 
				g.beginFill(0xFF4500); 
			} 
			else if (data[DataGridListData(listData).dataField] == 10) { 
				g.beginFill(0xFF6600); 
			} 
			else if (data[DataGridListData(listData).dataField] == 11) { 
				g.beginFill(0xEEAD0E); 
			} 
			else if (data[DataGridListData(listData).dataField] == 12) { 
				g.beginFill(0xFFC125); 
			}
			else if (data[DataGridListData(listData).dataField] == 13){ 
				g.beginFill(0xE6B426); 
			} 
			else if (data[DataGridListData(listData).dataField] == 14){ 
				g.beginFill(0xFFCC11); 
			}
			else if (data[DataGridListData(listData).dataField] == 15){ 
				g.beginFill(0xFFFF00); 
			} 
			else if (data[DataGridListData(listData).dataField] == 16) { 
				g.beginFill(0xEEEE00); 
			} 
			else if (data[DataGridListData(listData).dataField] == 17) { 
				g.beginFill(0xCCCC00); 
			} 
			else if (data[DataGridListData(listData).dataField] == 18) { 
				g.beginFill(0xCDCD00); 
			} 
			else if (data[DataGridListData(listData).dataField] == 19){ 
				g.beginFill(0x66CD00); 
			} 
			else if (data[DataGridListData(listData).dataField] == 20){ 
				g.beginFill(0x004F00); 
			} 
			else if (data[DataGridListData(listData).dataField] == 21){ 
				g.beginFill(0x0000FF); 
			} 
			else if (data[DataGridListData(listData).dataField] == 22) { 
				g.beginFill(0x00009C); 
			} 
			else if (data[DataGridListData(listData).dataField] == 23) { 
				g.beginFill(0x000080); 
			} 
			g.drawRect(0, 0, unscaledWidth, unscaledHeight); g.endFill(); 
		} 
	} 
}